import request from '@/utils/request'
import { get } from 'sortablejs'

export default {

  addGrid(data) {
    const url = 'main/grid'
    return request.postJson(url, data)
  },
  updateGird(data) {
    const url = 'main/grid'
    return request.putJson(url, data)
  },

  getGridTree() {
    const url = 'main/grid/tree'
    return request.get(url)
  },
  getPositionList(data) {
    const url = 'main/position?' + data.label + '=' + data.value
    return request.get(url)
  },
  getGridDeviceActive(data){
    const url = 'main/equipment/list/fullPath?gridMount='+data.gridMount+'&pageNum='+data.pageNum+'&pageSize='+data.pageSize+'&deviceCode='+data.deviceCode+'&deviceName='+data.deviceName
    return request.get(url)
  },
  getDeptTree() {
    const url = 'system/dept'
    return request.get(url)
  },
  getGridDetailList(data) {
    const url = 'main/grid/detailList'
    return request.get(url, data)
  },
  deleteGrid(data) {
    const url = 'main/grid/' + data
    return request.delete(url)
  },
  getGridAll(data) {
    const url = 'main/grid/all'
    return request.get(url, data)
  },
  getGridDetail(data) {
    const url = 'main/grid/detail/' + data
    return request.get(url)
  },
  getList2DPoint(data) {
    const url = 'main/equipment/list2DPoint/' + data
    return request.get(url)
  },
  addList2D(data) {
    const url = 'main/equipmentExtend2D/addList2D' 
    return request.postJson(url,data)
  },
  // http://192.168.100.23:10393/shareDoc?issue=850514878e77b2f85c3ee6849fc78c64
  getListCamera2DPoint(data) {
    const url = 'console/equipmentCamera/list2DPoint/'+ data
    return request.get(url)
  }
}
